import unittest, requests


class Movie(unittest.TestCase):
    host = 'http://10.59.9.18/'

    # 登录
    def test_Movie_01_login(self):
        url = 'movieApi/user/v2/login'
        json = {'email': '3601552946@qq.com', 'pwd': 'eWLPHopE945d2ivttHaQTQ=='}
        login = requests.post(url=Movie.host + url, data=json)
        print(login.json())

    # 查询区域列表
    regionId = None

    def test_Movie_02_RegionList(self):
        url = 'movieApi/tool/v2/findRegionList'
        RegionList = requests.get(url=Movie.host + url)
        print(RegionList.json())
        Movie.regionId = RegionList.json()['result'][6]['regionId']
        print('regionId:', Movie.regionId)

    # 查询热门电影列表
    def test_Movie_HotMovieList(self):
        url = Movie.host + 'movieApi/movie/v2/findHotMovieList'
        HotMovieList = {'page': 1, 'count': 1}


if __name__ == '__main__':
    unittest.main()
